Skip to content

Fix fpm-deployment CI: pin action versions and fix lcov example exclusion#1191

Open
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-ci-fpm-deployment
Open

Fix fpm-deployment CI: pin action versions and fix lcov example exclusion#1191
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-ci-fpm-deployment

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown

The fpm-deployment coverage job was failing to exclude example files from the coverage report, causing newly-added examples (0% covered by fpm test) to dilute the stdlib source coverage metric. The deploy job also used setup-fortran@main, an unstable floating ref.

Root cause

lcov 2.0 (Ubuntu 24.04 / current ubuntu-latest) changed * glob semantics — it no longer matches /. The existing filter:

lcov --remove coverage.info '*/example/*' ...

never matched fpm's relative source paths (e.g. example/ascii/example_ascii_to_lower.f90) because the leading * requires at least one path component before example/. All 100+ example files remained in the uploaded coverage.info, each with 0% line coverage.

Changes

  • Fix lcov --remove pattern — add example/** to cover relative paths at any depth; keep */example/* for absolute paths; add --ignore-errors unused,mismatch,inconsistent:
    lcov --remove coverage.info '*/example/*' 'example/**' \
      --output-file coverage.info --ignore-errors unused,mismatch,inconsistent
  • Pin fortran-lang/setup-fortran@main@v1.6.2 in both deploy and coverage jobs to prevent silent breakage from upstream HEAD changes
  • Update stale action versions in deploy job: actions/checkout@v2.3.1@v4, actions/setup-python@v1@v5

…sion

- Pin fortran-lang/setup-fortran@main to @v1.6.2 in both deploy and
  coverage jobs to avoid breakages from HEAD changes
- Update actions/checkout@v2.3.1 -> @v4 and setup-python@v1 -> @v5
  in deploy job to use current supported versions
- Fix lcov --remove pattern for example file exclusion:
  * lcov 2.x (Ubuntu 24.04) changed * glob to NOT match /
  * The old pattern */example/* only matched absolute paths with one
    path component before example and one after (not recursive)
  * fpm stores source paths as relative (e.g. example/ascii/file.f90),
    which the old pattern never matched
  * Add example/** to cover relative paths at any depth
  * Add --ignore-errors unused,mismatch to handle edge cases

This ensures example programs (compiled but never run by fpm test)
are excluded from the coverage denominator, preventing newly-added
examples from diluting the stdlib source coverage metric.
Copilot AI changed the title [WIP] Fix CI failures for fpm-deployment workflow and coverage Fix fpm-deployment CI: pin action versions and fix lcov example exclusion Jun 24, 2026
Copilot AI requested a review from jalvesz June 24, 2026 13:52
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.84%. Comparing base (4c8521d) to head (46e4eb6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1191      +/-   ##
==========================================
+ Coverage   68.81%   68.84%   +0.02%     
==========================================
  Files         408      408              
  Lines       13726    13726              
  Branches     1552     1552              
==========================================
+ Hits         9446     9450       +4     
+ Misses       4280     4276       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jalvesz jalvesz marked this pull request as ready for review June 24, 2026 14:57
@jalvesz jalvesz requested review from a team, jvdp1, loiseaujc and perazz June 24, 2026 16:15
@jalvesz

jalvesz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi @fortran-lang/admins @fortran-lang/actions @fortran-lang/stdlib would it be possible to take a look to this PR to validate it and get it merged? there has been a consistant fail with the fpm job for stdlib and this PR solves it. Thank you!

@jvdp1 jvdp1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. thank you @jalvesz

Comment thread .github/workflows/fpm-deployment.yml Outdated
# Exclude example files from coverage: use both absolute-path pattern (*/example/*)
# and relative-path pattern (example/**) because lcov 2.x requires ** for recursive matching
# and the fpm build stores paths relative to the project root.
lcov --remove ${{ env.COV_DIR }}/coverage.info '*/example/*' 'example/**' --output-file ${{ env.COV_DIR }}/coverage.info --ignore-errors unused,mismatch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some of my pipeline, I also use inconsistent in addition to unused and mismatch. I don't know if it would be useful here.

run: pip install --upgrade -r config/requirements.txt

- uses: fortran-lang/setup-fortran@main
- uses: fortran-lang/setup-fortran@v1.6.2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? is main not preferable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try again with main, I set copilot to the task and during the session (https://github.com/fortran-lang/stdlib/sessions/863fa058-b2eb-4818-b0bb-ae67d39a0abb) it found problems with the main version

jalvesz added 2 commits July 1, 2026 19:53
Updated setup-fortran action to use the main branch and modified lcov command to ignore 'inconsistent' errors.
Updated Fortran setup action to version 1.6.2 in deployment workflow.
@jalvesz

jalvesz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@copilot can you revert my last two commits but leave the suggestion to add "inconsistent" at line 122 when launching lcov ?

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Author

@copilot can you revert my last two commits but leave the suggestion to add "inconsistent" at line 122 when launching lcov ?

The two commits have been reverted. The current state of the workflow now matches the original Copilot commit (304d2ca9) plus inconsistent added to the lcov --ignore-errors flag (as suggested by @jvdp1):

lcov --remove ... --ignore-errors unused,mismatch,inconsistent

setup-fortran remains pinned at @v1.6.2.

Copilot AI requested a review from jalvesz July 1, 2026 19:01
@jalvesz

jalvesz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@jvdp1 I tried again the main branch of setup-fortran but there seems to be an issue with it. So copilot was right to point to a stable version. No idea what's going on there.

By the way, I'm thinking that we should remove the XDP and QP kinds check in the fpm jobs as those are validated in the cmake jobs which are much faster to build and run. Let me know your thoughts and I can include that in this same PR.

@jvdp1

jvdp1 commented Jul 1, 2026

Copy link
Copy Markdown
Member

@jvdp1 I tried again the main branch of setup-fortran but there seems to be an issue with it. So copilot was right to point to a stable version. No idea what's going on there.

Good. thank you for testing it.

By the way, I'm thinking that we should remove the XDP and QP kinds check in the fpm jobs as those are validated in the cmake jobs which are much faster to build and run. Let me know your thoughts and I can include that in this same PR.

I agree with you. I guess that the goal for the CI//CD for fpm is mainly to check the compatibility of fpm and stdlib (rather than checking the code for XDP and QP).

Removed xdp and qp checks from deployment workflow and updated coverage testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants